﻿using FriendStar.Code;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
using FriendStar.Application.VBaseData;
using FriendStar.Domain.Entity.VBaseData;

namespace FriendStar.Web.Areas.VBaseData.Controllers
{
    public class V_BUS_SJ_DictionaryController : Controller
    {
        //
        // GET: /VBaseData/V_BUS_SJ_Dictionary/GetSJ_DictionaryEntity

        public ActionResult Index()
        {
            return View();
        }
        private V_BUS_SJ_DictionaryApp V_BUS_SJ_DictionaryApp = new V_BUS_SJ_DictionaryApp();

        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(string keyword)
        {
            var data = V_BUS_SJ_DictionaryApp.GetList();
            return Content(data.ToJson());
        }
        public ActionResult GetSJ_DictionaryEntity()
        {
            var data = V_BUS_SJ_DictionaryApp.GetSJ_DictionaryEntity(Configs.GetValue("UseUnit"), "01");
            return Content(data.ToJson());
        }
        /// <summary>
        /// 零件分类
        /// </summary>
        /// <returns></returns>
        public ActionResult GetPartClass()
        {
            var data = V_BUS_SJ_DictionaryApp.GetSJ_DictionaryEntity(Configs.GetValue("UseUnit"), "01");
            return Content(data.ToJson());
        }
        /// <summary>
        /// 发生方式
        /// </summary>
        /// <returns></returns>
        public ActionResult GetWayNodesForNotice()
        {
            var data = V_BUS_SJ_DictionaryApp.GetWayNodesForNotice(Configs.GetValue("UseUnit"));
            return Content(data.ToJson());
        }

        public ActionResult GetSJ_DictionaryEntityByClassNo(string classNo)
        {
            var data = V_BUS_SJ_DictionaryApp.GetSJ_DictionaryEntity(Configs.GetValue("UseUnit"),classNo);
            return Content(data.ToJson());
        }

        public ActionResult GetSJ_DictionaryEntityByTypeNo(string typeNo)
        {
            var data = V_BUS_SJ_DictionaryApp.GetSJ_DictionaryEntityByTypeNo(Configs.GetValue("UseUnit"), typeNo);
            return Content(data.ToJson());
        }

        public ActionResult GetOccurrenceUnit()
        {
            var data = V_BUS_SJ_DictionaryApp.GetOccurrenceUnit();
            return Content(data.ToJson());
        }

        public ActionResult GetStoreType()
        {
            var data = V_BUS_SJ_DictionaryApp.GetStoreType();
            return Content(data.ToJson());
        }
    }
}
